//
//  AccountViewController.m
//  WDFans
//
//  Created by Apple Inc on 4/3/12.
//  Copyright (c) 2012 AppleInc. All rights reserved.
//

#import "AccountViewController.h"
#import "LogoutViewController.h"

@interface AccountViewController ()

@end

@implementation AccountViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"账号设置";
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


#pragma mark - UITableViewDataSource methods
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIdentify = @"cellIdentify";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentify];
    if(cell == nil)
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentify] autorelease];
        cell.textLabel.textColor = [UIColor cellLeftKeyTextColor];
        cell.textLabel.font = [UIFont getSettingViewTableCellLabelFont];
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    if([indexPath row]==0)
    {
        cell.textLabel.text = @"WD账号设置";
    }
    else {
        cell.textLabel.text = @"微博账号设置";
    }
        
    return cell;
}

#pragma mark - UITableViewDelegate methods
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    LogoutViewController* vc = [[LogoutViewController alloc] initWithNibName:@"LogoutViewController" bundle:nil];
    if ([indexPath row]==0) {
        
        vc.isWeibo = NO;
    }
    else {
        vc.isWeibo = YES;
    }
    
    [self.navigationController pushViewController:vc animated:YES];
    
    [vc release];
    
}


@end
